import {createApp} from 'vue'
import App from './App.vue'

//elementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'dayjs/locale/zh-cn';//中文
import locale from 'element-plus/lib/locale/lang/zh-cn';//中文

//router
import {useRouter} from '@/router'

//pinia
import {createPinia} from 'pinia'
//pinia持久化
import piniaPersist from 'pinia-plugin-persist'

//windi.css
import 'virtual:windi.css'

//使用piniaPersist持久化
const pinia = createPinia().use(piniaPersist)

//定义app
const app = createApp(App).use(ElementPlus, {locale}).use(useRouter).use(pinia)

//全局获取所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
